package demo1;

import java.util.*;

/**
 * @Author liangzai
 * @Description:
 */
public class Test {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        long sum = scanner.nextLong();
        long[] p = new long[n];
        long[] s = new long[n];
        int count = 0;
        for (int i = 0; i < n; i++) {
            p[i] = scanner.nextInt();
            s[i] = scanner.nextInt();
        }
        for (int i = 0; i < n; i++) {
            long[] array = new long[n];
            long all = 0;
            int max = n;
            for (int j = 0; j < n; j++) {
                if (j != i) {
                    array[j] = p[j]+s[j];
                }else {
                    array[j] = p[j]/2-1+s[j];
                }
                all += array[j];
            }
            Arrays.sort(array);
            for (int j = n-1; j >=0 ; j--) {
                if (sum < all) {
                    all -= array[j];
                    max--;
                }else {
                    break;
                }
            }
            count = count>=max?count:max;
        }
        System.out.println(count);
    }

    public void rotate(int[][] matrix) {

        int n = matrix.length;
        int[][] matrix_new = new int[n][n];
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < n; ++j) {
                matrix_new[j][n - i - 1] = matrix[i][j];
            }
        }
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < n; ++j) {
                matrix[i][j] = matrix_new[i][j];
            }
        }
    }


    public int triangleNumber(int[] nums) {
        Arrays.sort(nums);
        int count = 0;
        int end = nums.length-1;
        for (int i = end; i >=2 ; i--){
            int l = 0;
            int r = i-1;
            while (l < r) {
                if(nums[l]+nums[r]>nums[i]){
                    count += r-l;
                    r--;
                }else {
                    l++;
                }
            }
        }
        return count;
    }


//    public String convert(String s, int numRows) {
//        StringBuilder stringBuilder = new StringBuilder();
//        for (int i = 0; i < ; i++) {
//
//        }
//    }


    public int duplicateNumbersXOR(int[] nums) {
        int key = 0;
        HashSet<Integer> set = new HashSet<>();
        for (int i = 0; i < nums.length; i++) {
            if(!set.contains(nums[i])){
                set.add(nums[i]);
            }else {
                if (key == 0) {
                    key = nums[i];
                }else {
                    key ^= nums[i];
                }
            }
        }
        return key;
    }

    public int reverse(int x) {
        if (x < Integer.MIN_VALUE / 10 || x > Integer.MAX_VALUE / 10) {
            return 0;
        }

        int flag = 0;
        int num = x;
        if (num < 0) {
            num = -num;
            flag = 1;
        }

        Queue<Integer> queue = new LinkedList<>();
        while (num != 0) {
            queue.offer(num % 10);
            num /= 10;
        }
        int ret = 0;
        while(!queue.isEmpty()){
            int a = queue.poll();
            if (a == 0 && queue.isEmpty()) {
                break;
            }
            ret += a;
            if (!queue.isEmpty()) {
                ret*=10;
            }
        }
        return flag==1?-ret:ret;
    }

    public static void main3(String[] args) {
        Scanner scanner = new Scanner(System.in);
        double a = scanner.nextFloat();
        double b = scanner.nextFloat();
        double c = scanner.nextFloat();

        double num = (b*b)-(4*a*c);
        if (num > 0) {
            double x1 = (-b+Math.sqrt(num))/(2*a);
            double x2 = (-b-Math.sqrt(num))/(2*a);
            System.out.printf("方程有两个解：x1=%.2f x2=%.2f",x1,x2);
        } else if (num == 0) {
            double x1 = (-b+Math.sqrt(num))/(2*a);
            System.out.printf("方程有一个解：x1=%.2f",x1);
        }else {
            System.out.println("此方程无解");
        }
    }

    public static void main2(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int c = scanner.nextInt();

        for (int i = a; i <= b; i++) {
            if (i % c == 0) {
                System.out.println(i);
            }
        }
    }

    public static void main1(String[] args) {
        Scanner scanner =  new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();

        System.out.println(a+"到"+b+"之间的素数有：");
        for (int i = a; i <= b; i++) {
            if (i == 1 ) {
                System.out.print(i+" ");
            }
            int j = 0;
            for (j = 2; j < i; j++) {
                if (i % j == 0) {
                    break;
                }
            }
            if(j==i){
                System.out.print(i+" ");
            }
        }
    }
}
